package com.one.controller;


import com.one.bo.MajorBo;
import com.one.bo.RoleBo;
import com.one.dto.Result;
import com.one.entity.SysMajorEntity;
import com.one.entity.SysRoleEntity;
import com.one.service.SysMajorService;

import com.one.service.SysRoleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fr
 * @since 2021-10-12
 */
@RestController
@RequestMapping("/major")
public class SysMajorController {
    private final SysMajorService sysMajorService;

    public SysMajorController(SysMajorService sysMajorService) {
        this.sysMajorService = sysMajorService;
    }

    @ApiOperation(value = "条件查询系部", notes = "条件查询系部")
    @PostMapping("/selectMajor")
    public Result selectMajor (@RequestBody MajorBo majorBo){
        return sysMajorService.selectMajor(majorBo);
    }

    @ApiOperation(value = "删除系部", notes = "删除系部")
    @PostMapping("/deleteMajor")
    public Result deleteMajor(@RequestBody MajorBo majorBo) {
        return sysMajorService.deleteMajor(majorBo);
    }

    @ApiOperation(value = "添加系部", notes = "添加系部")
    @PostMapping("/addMajor")
    public Result addMajor(@RequestBody SysMajorEntity sysMajorEntity) { return sysMajorService.addMajor(sysMajorEntity);
    }

    @ApiOperation(value = "修改角色信息", notes = "修改角色信息")
    @PostMapping("/updateMajor")
    public Result updateMajor(@RequestBody SysMajorEntity sysMajorEntity) {
        return sysMajorService.updateMajor(sysMajorEntity);
    }
    @ApiOperation(value = "有效批次", notes = "有效批次")
    @GetMapping("/getcollegeCode")
    public Result getcollegeCode() {
        return sysMajorService.getcollegeCode();
    }
    @ApiOperation(value = "有效批次", notes = "有效批次")
    @GetMapping("/getceachCode")
    public Result getceachCode() {
        return sysMajorService.getceachCode();
    }

}

